package 图形界面;


import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class deleteSDrom {
    //图十九框架
    private JFrame frame19=new JFrame("删除面板");
    private JLabel lal1=new JLabel("请输入要删除哪位的同学的名字");
    private JTextField lal2=new JTextField(20);

    //图二十框架
    private JFrame frame20=new JFrame("成功");
    private JLabel la=new JLabel("已经成功删除该名学生");
    private JButton but10=new JButton("确认");
    public deleteSDrom() {
        frame19.setSize(550, 400);
        frame19.setLocation(500, 200);
        frame19.setLayout(new FlowLayout());
        frame19.add(lal1);
        frame19.add(lal2);
        frame19.add(but10);
        frame19.setVisible(true);
        but10.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                frame19.setVisible(false);
                frame20.setSize(550, 400);
                frame20.setLocation(500, 200);
                frame20.setLayout(new FlowLayout());
                frame20.add(la);
                String SNAME=lal2.getText();
                try {
                    JDBC1.delete1(SNAME);
                } catch (Exception ex) {
                    throw new RuntimeException(ex);
                }
                frame20.setVisible(true);
                frame20.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            }
        });
        frame19.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
}
